package com.smfx.yxt.service;

import java.util.List;

import com.smfx.yxt.model.SchoolPropertyGoodsAttr;
import com.smfx.yxt.model.SchoolPropertyGoodsName;
import com.smfx.yxt.model.SchoolPropertyGoodsStock;
import com.smfx.yxt.model.SchoolPropertyGoodsStockDetail;
import com.smfx.yxt.model.SchoolPropertyGoodsType;
import com.smfx.yxt.model.SchoolPropertyInput;
import com.smfx.yxt.model.SchoolPropertyInputDetail;
import com.smfx.yxt.model.SchoolPropertyOutputRecord;
import com.smfx.yxt.page.Page;
import com.smfx.yxt.reqVo.SchoolPropertyExportQueryVo;
import com.smfx.yxt.reqVo.SchoolPropertyGoodTypeReqVo;
import com.smfx.yxt.reqVo.SchoolPropertyGoodsStockDetailQueryVo;
import com.smfx.yxt.reqVo.SchoolPropertyInputReqVo;
import com.smfx.yxt.reqVo.SchoolPropertyOutputRecordReqVo;
import com.smfx.yxt.view.SchoolPropertyConsumablesApplyExportView;
import com.smfx.yxt.view.SchoolPropertyGoodsTypeView;
import com.smfx.yxt.view.SchoolPropertyInputExportView;
import com.smfx.yxt.view.SchoolPropertyLendAndReturnExportView;
import com.smfx.yxt.view.SchoolPropertyOutputRecordView;
import com.smfx.yxt.view.SchoolPropertyStockExportView;
import com.smfx.yxt.view.SchoolPropertyStockView;

/**
 * 校产管理
 * 
 * */
public interface ISchoolPropertyService {

	/**
	 * 物品入库
	 * @param vo 物品信息
	 * @return inputId 入库单号对应记录的ID，用于添加多件物品
	 * @throws 事务回退
	 * */
	int insertStock( SchoolPropertyInputReqVo vo) throws Exception;
	
	int insertGoodsType(SchoolPropertyGoodTypeReqVo e);

	List<SchoolPropertyGoodsType> selectTypeByPage(Page<SchoolPropertyGoodsType> page);
	
	List<SchoolPropertyGoodsName> selectGoodsName(Integer typeId);
	

	List<SchoolPropertyInput> selectInputRecordByPage(Page<SchoolPropertyInput> page);
	/**
	 * 添加物品类型
	 * */
	SchoolPropertyGoodsType insertType(SchoolPropertyGoodsType type);
	/**
	 * 添加物品名称
	 * */
	SchoolPropertyGoodsName insertName(SchoolPropertyGoodsName name);
	/**
	 * 添加物品属性
	 * */
	SchoolPropertyGoodsAttr insertAttr(SchoolPropertyGoodsAttr attr);
	/**
	 * 通过学校Id选择所有的物品类型,名称，属性
	 * @param cycleUse 
	 * */
	List<SchoolPropertyGoodsTypeView> selectAllBySchoolId(Integer schoolId, Integer cycleUse);

	/**
	 * 分页查询库存信息
	 * */
	List<SchoolPropertyStockView> selectStockByPage(Page<SchoolPropertyStockView> page);
	
	/**
	 * 使用记录添加
	 * */
	void insertOutputRecord(SchoolPropertyOutputRecordReqVo reqvo) throws Exception;

	/**
	 * 查询物品使用记录
	 * @param page 
	 * @return List<SchoolPropertyOutputRecord>
	 * */
	List<SchoolPropertyOutputRecord> seleOutputRecordByPage(Page<SchoolPropertyOutputRecord> page);
	
	/**
	 * 查询非消耗品的库存信息
	 * */
	List<SchoolPropertyGoodsStockDetail> selectStockDetailByPage(Page<SchoolPropertyGoodsStockDetail> page);

	/**
	 * 查询入库详情
	 * */
	List<SchoolPropertyInputDetail> selectInputDetailByPage(Page<SchoolPropertyInputDetail> page);

	/**
	 * 使用记录查询
	 * */
	SchoolPropertyOutputRecord selectOutputRecord(Integer outputId);
	
	/**
	 * 使用记录查询view
	 * */
	SchoolPropertyOutputRecordView selectOutputRecordView(Integer outputId);

	/**
	 * 物品归还
	 * */
	void updateSchoolPropertyOutputRecord(SchoolPropertyOutputRecordReqVo vo) throws Exception;

	/**
	 * 非消耗品库存查询
	 * */
	SchoolPropertyGoodsStock selectStockNumberByParams(SchoolPropertyGoodsStockDetailQueryVo qvo);

	/**
	 * 库存导出
	 * */
	List<SchoolPropertyStockExportView> selectAllStockForExportToExcelByParams(SchoolPropertyExportQueryVo vo);
	
	List<SchoolPropertyStockExportView> selectAllStockForExportToExcelByPage(Page<SchoolPropertyStockExportView> page);
	/**
	 * 入库记录导出
	 * */
	List<SchoolPropertyInputExportView> selectSchoolPropertyInputForExportToExcelByParams(SchoolPropertyExportQueryVo vo);
	List<SchoolPropertyInputExportView> selectSchoolPropertyInputForExportToExcelByPage(Page<SchoolPropertyInputExportView> page);
	/**
	 * 消耗品领用导出
	 * */
	List<SchoolPropertyConsumablesApplyExportView> selectSchoolPropertyConsumablesApplyForExportToExcelByParams(SchoolPropertyExportQueryVo vo);
	List<SchoolPropertyConsumablesApplyExportView> selectSchoolPropertyConsumablesApplyForExportToExcelByPage(Page<SchoolPropertyConsumablesApplyExportView> page);
	/**
	 * 非消耗品借还导出
	 * */
	List<SchoolPropertyLendAndReturnExportView> selectSchoolPropertyLendAndReturnForExportToExcelByParams(SchoolPropertyExportQueryVo vo);
	List<SchoolPropertyLendAndReturnExportView> selectSchoolPropertyLendAndReturnForExportToExcelByPage(Page<SchoolPropertyLendAndReturnExportView> page);
}
